package atri.mapper;

import atri.model.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper extends BaseMapper<User> {
    @Select("select count(*) from user where id=#{id} and password=#{password}")
    int login(int id,String password);
    @Select("select * from user where name=#{name}")
    User getUserByName(String name);
    @Select("select * from user where name LIKE '%${name}%'")
    List<User> getUserByName_true(String name);
}
